package com.example.bcvicse.com.dao;

import com.example.bcvicse.com.pojo.BData;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

/**
 * @ClassName ReceiveDAO
 * @创建人 李劲松
 * @创建时间 2022/7/20 13:00
 * @描述 B机构接收数据后与数据库交互操作类
 */
@Mapper
@Repository
public interface ReceiveDAO {
    @Insert("insert into t_data(id,enTime,enTollStationName,exTime,exTollStationName,vehicleId,vehicleType,fee,receiveTime) values(#{id},#{enTime},#{enTollStationName},#{exTime},#{exTollStationName},#{vehicleId},#{vehicleType},#{fee},#{data})")
    int addBData(String id, String enTime, String enTollStationName, String exTime, String exTollStationName, String vehicleId, String vehicleType, double fee ,Date data);

    @Select("select * from t_data where id = #{id}")
    List<BData> selectById(String id);
}
